Search for elements by XPath selectors
Categories
(DevTools :: Inspector, enhancement, P2)
Tracking
(firefox75 fixed)
Tracking | Status | |
---|---|---|
firefox75 | --- | fixed |
People
(Reporter: bghome, Assigned: sebo)
References
(Blocks 4 open bugs)
Details
(Keywords: dev-doc-complete)
Attachments
(3 files)
Comment 4•11 years ago
|
||
Comment 6•11 years ago
|
||
Comment 8•11 years ago
|
||
Comment 10•9 years ago
|
||
Assignee | ||
Updated•8 years ago
|
Assignee | ||
Comment 11•8 years ago
|
||
Comment 12•8 years ago
|
||
Comment 13•8 years ago
|
||
Comment hidden (me-too) |
Updated•8 years ago
|
Comment 15•8 years ago
|
||
Comment 16•8 years ago
|
||
Comment 17•8 years ago
|
||
Comment 18•8 years ago
|
||
Comment 19•8 years ago
|
||
Assignee | ||
Comment 20•8 years ago
|
||
Comment hidden (advocacy) |
Comment hidden (advocacy) |
Comment 23•8 years ago
|
||
Comment hidden (me-too) |
Assignee | ||
Comment 25•7 years ago
|
||
Comment hidden (advocacy) |
Updated•7 years ago
|
Comment 27•6 years ago
|
||
Searching for elements by XPath via the Inspector's find tool was a great alternative, but now it is also gone.
https://superuser.com/questions/1407080/how-do-i-search-with-xpath-in-firefox-quantum-65/1407554
Comment hidden (off-topic) |
Comment hidden (off-topic) |
Comment 32•5 years ago
|
||
(In reply to Sebastian Zartner [:sebo] from comment #31)
(In reply to 98gmarquee from comment #30)
I only see a "follow" button.
The Vote button is in the Details section at the top, right besides the number of votes.
Sebastian
Thanks!
Assignee | ||
Comment 33•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Comment 34•5 years ago
|
||
Depends on D64859
Assignee | ||
Comment 35•5 years ago
|
||
Because I am also missing this feature for quite some time now, I had a look into it and came up with a patch.
Two notes to the revisions:
- The XPath search generally works quite well, though there is a case where it fails:
Try//p/text()
on devtools/server/tests/browser/inspector-search-data.html; The first time you hit Enter selects the text node of the<p>
element (OK), but the second time changes the structure in the Inspector (see the attached screenshot). - The test devtools/client/inspector/test/browser_inspector_search-09.js fails on finding the text nodes. Instead, the containing element is selected.
Julian, it would be great if you helped me finding what's wrong. Thank you in advance!
Sebastian
Assignee | ||
Comment 36•5 years ago
|
||
I found out what's causing the bug regarding searching for text nodes. Empty text nodes are not displayed in the Inspector, so they need to be filtered out when searching.
So only the test for finding the text nodes still needs to be fixed. And I don't know how yet, so help is still appreciated.
Sebastian
Comment 37•5 years ago
|
||
(In reply to Sebastian Zartner [:sebo] from comment #36)
I found out what's causing the bug regarding searching for text nodes. Empty text nodes are not displayed in the Inspector, so they need to be filtered out when searching.
So only the test for finding the text nodes still needs to be fixed. And I don't know how yet, so help is still appreciated.
Sebastian
Hi Sebastian!
Sorry about the delay. The reason your test fails is that we don't create "node fronts" for small text nodes (< 50 characters). They are called "inline text child", and are merged with their container.
If you add text nodes in your test document with more than 50 characters, they will be represented by dedicated node fronts in the markup view, and they will be individually selected.
Assignee | ||
Comment 38•5 years ago
|
||
Thanks a lot for the hint with the > 50 characters, Julian! That was it.
I've updated the patch and fixed the tests according to your feedback.
If there are no more issues left, it would be great if that patch could still make it into 75. But no pressure!
Sebastian
Comment 39•5 years ago
|
||
Reviewed. Happy we can get that in 75 as well, I played a bit with the feature and I found it really handy.
Assignee | ||
Comment 40•5 years ago
|
||
Julian, can you please do the push to auto-land for me? I don't have the rights yet.
Sebastian
Comment 41•5 years ago
|
||
(In reply to Sebastian Zartner [:sebo] from comment #40)
Julian, can you please do the push to auto-land for me? I don't have the rights yet.
Sebastian
Ok but I'll file a follow up to add a test which covers xPaths with a single starting /
then.
Comment 42•5 years ago
|
||
Comment 43•5 years ago
|
||
Backed out 2 changesets (bug 963933) for causing devtools failures on browser_inspector_search-03.js
Backout revision https://hg.mozilla.org/integration/autoland/rev/ae9cf7958b616fcacb2bce02ae5b8f0f2260f93f
Failure logs https://treeherder.mozilla.org/logviewer.html#?job_id=291610274&repo=autoland
Sebastian can you please take a look?
Assignee | ||
Comment 44•5 years ago
|
||
Thanks for getting back to me! I've fixed the tests now.
Sebastian
Comment 45•5 years ago
|
||
Comment 46•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/b3e868335a61
https://hg.mozilla.org/mozilla-central/rev/89218ad04c6d
Assignee | ||
Comment 47•5 years ago
•
|
||
I've described this in https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector/How_to/Examine_and_edit_HTML#Searching and added a release note for it at https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/75.
Will, can you please have a look and tell me if it's ok?
Sebastian
Comment 48•5 years ago
|
||
Thanks for this, Sebastian. I'm not really working on devtools docs any more, but Janet is, so I will attempt to transfer this to her :).
Assignee | ||
Comment 50•5 years ago
|
||
Thank you both for your help! So let's call this dev-doc-complete, then. :-)
Sebastian
Description
•